<%@ page language="java" %>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                  java.util.HashMap,
                  java.util.Iterator"%>
<%@ page import="com.scalar.chiptrack.operations.proformainvoice.BankInfo" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/proformaInvoice.do"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<%--<%
    try{
        
%>--%>
<SCRIPT language="JavaScript">

<% HashMap bankInfoMap = (HashMap)request.getAttribute("BankInfo");

	if(bankInfoMap != null)
	{
		int  bankNamesSize = bankInfoMap.size();
		Iterator bankInfoIterator  = bankInfoMap.keySet().iterator();

		%>
			//alert(<%=bankNamesSize%>);
			var bankID    = new Array(<%=bankNamesSize%>);
			var bankName  = new Array(<%=bankNamesSize%>);
			var address   = new Array(<%=bankNamesSize%>);
			var city      = new Array(<%=bankNamesSize%>);
			var state     = new Array(<%=bankNamesSize%>);
			var zipcode   = new Array(<%=bankNamesSize%>);
			var country   = new Array(<%=bankNamesSize%>);
			var aba       = new Array(<%=bankNamesSize%>);
			var acct      = new Array(<%=bankNamesSize%>);
			var swiftcode = new Array(<%=bankNamesSize%>);

		<%
		BankInfo bankInfo[] = new BankInfo[bankNamesSize];
		for( int jj = 0; jj < bankNamesSize; jj++)
        {
			String key = (String)bankInfoIterator.next();
			if(bankInfoMap.get(key) != null)
			{
				if(bankInfoMap.containsKey(key))
				{
					bankInfo[jj] = (BankInfo)bankInfoMap.get(key);
					%>
						 bankID[<%=jj%>]    = '<%=bankInfo[jj].getBankId()%>';
						 bankName[<%=jj%>]  = '<%=bankInfo[jj].getBankName()%>';
						 address[<%=jj%>]   = '<%=bankInfo[jj].getAddress()%>';
						 city[<%=jj%>]      = '<%=bankInfo[jj].getCity()%>';
						 state[<%=jj%>]     = '<%=bankInfo[jj].getState()%>';
						 zipcode[<%=jj%>]   = '<%=bankInfo[jj].getZipCode()%>';
						 country[<%=jj%>]   = '<%=bankInfo[jj].getCountry()%>';
						 aba[<%=jj%>]       = '<%=bankInfo[jj].getAba()%>';
						 acct[<%=jj%>]      = '<%=bankInfo[jj].getAcct()%>';
						 swiftcode[<%=jj%>] = '<%=bankInfo[jj].getSwiftCode()%>';
					<%
				}

			}
		}//for
	}
%>


var dateElement = "";
function openCalendar( dateValue )
{
    dateElement = dateValue;
    newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
    newWindow.focus();
}
function assignDate( passedValue )
{
    dateElement.value=passedValue;
    window.focus();
}

function selectLineItem( x )
{
    var form = document.proformaInvoiceForm;
    if ( form[ 'lineItemList[' + x +'].selected'].checked )
    {
        form[ 'lineItemList[' + x +'].qtyPulledStr'].disabled = false;
    }
    else
    {
        form[ 'lineItemList[' + x +'].qtyPulledStr'].disabled = true;
        form[ 'lineItemList[' + x +'].qtyPulledStr'].value = "";
    }
    /*checkMessage();*/
}

function resetSalesOrderIdAndPOValues()
{
    document.proFormaInvoiceForm.salesOrderId.value = -1;
    document.proFormaInvoiceForm.poSalesOrderId.value = -1;
}

function confirmInvoice(salesOrderId)
{
    document.proFormaInvoiceForm.action = '<%=chipTracContext%>/proFormaInvoice.do?action=ConfirmToDeleteInvoice&Flag=True&salesOrderId=' + salesOrderId;
    document.proFormaInvoiceForm.submit();
}

function cancelPage(salesOrderId)
{
    document.proFormaInvoiceForm.action.value = "CancelPage";
    document.proFormaInvoiceForm.action = '<%=chipTracContext%>/proFormaInvoice.do?action=CancelPage&salesOrderId=' + salesOrderId;
    document.proFormaInvoiceForm.submit();
}


function submitPage()
{
	if( document.proFormaInvoiceForm.salesOrderNumber.value.length == 0 && document.proFormaInvoiceForm.poSalesOrderId.value == -1 &&
		document.proFormaInvoiceForm.deletedInvoiceSalesOrderId.value == -1){
		document.proFormaInvoiceForm.txtErrMsg.value = 'Please choose or select a criteria to search';
		return;
	}

    if( document.proFormaInvoiceForm.salesOrderNumber.value.length != 0 )   // Load Invoice by Sales Order Number
    {
        document.proFormaInvoiceForm.salesOrderNumber.value = trim(document.proFormaInvoiceForm.salesOrderNumber.value);
        for( i=0; i < document.proFormaInvoiceForm.salesOrderId.length; i++ )
        {
            if( document.proFormaInvoiceForm.salesOrderId.options[i].innerText != -1 )
            {
                if ( document.proFormaInvoiceForm.salesOrderNumber.value == document.proFormaInvoiceForm.salesOrderId.options[i].innerText )
                {
                    loadInvoiceByEnteredSalesOrderNumber();
                    return;
                }
            }
        }

        var salesOrderDatails = document.getElementById("salesOrderDetails");
        if( salesOrderDatails != null ){
		    salesOrderDatails.innerHTML = "";
            document.proFormaInvoiceForm.deletedInvoiceSalesOrderId.value = -1;
            document.proFormaInvoiceForm.poSalesOrderId.value = -1;
            document.proFormaInvoiceForm.salesOrderId.value = -1;
        }
        document.proformaInvoiceForm.txtErrMsg.value = 'Pro Forma Invoice does not exist for Sales Order Number: ' + document.proformaInvoiceForm.salesOrderNumber.value;
    }
}


function savePage()
{
    var form        = document.proformaInvoiceForm;
    var lineItemSize= form.lineItemSize.value;
    var actionType  = form.actionType.value;
    var errors      = '';
    
    var lineItemSelected    = false;
    var lineItemQtyPulled   = 0;
    var intialQtyPulled     = 0;

    if( form.invoiceNo.value == '' )
    {
		errors = errors + "<li> Please enter Invoice Number";
        form.invoiceNo.focus();
    }

    for( var i = 0; i < lineItemSize; i++ )
    {
        if( lineItemSize == 1 )
        {
            intialQtyPulled = form.intialQtyPulled.value;
        }
        else
        {
            intialQtyPulled = form.intialQtyPulled[i].value;
        }
        if( form[ 'lineItemList[' + i + '].selected' ].checked == true )
        {
            lineItemSelected = true;
            if( form['lineItemList['+ i +'].qtyPulledStr'].value <= 0 )
            {
                errors = errors +  "<li> Please Enter the Valid Qty Pulled in Line Item Information";
            }
            if( ( eval( form['lineItemList['+ i +'].qtyPulledStr'].value) >  ( eval( form['lineItemList['+ i +'].qtyAvailable'].value ) + eval( intialQtyPulled ) )  ) && ( form['lineItemList['+ i +'].poLineItemNo'].value != '' ) )
            {
                errors = errors +  "<li> The Quantity Pulled can not be Greater than " + ( eval( form['lineItemList['+ i +'].qtyAvailable'].value ) + eval( intialQtyPulled ) ) + " for Line Item No "+ form['lineItemList['+ i +'].poLineItemNo'].value ;
            }
            if(errors != '')
            {
                var pa=document.getElementById("errors");
                pa.innerHTML = errors;
                return;
            }
            lineItemQtyPulled = eval( lineItemQtyPulled ) + eval( form['lineItemList['+ i +'].qtyPulledStr'].value );
        }
    }
    if( lineItemSelected == false )
    {
        errors = errors + '<li> Please select at least one Line Item'
    }

    if ( errors != '' )
    {
        var pa=document.getElementById("errors");
        pa.innerHTML = errors;
        return;
    }
    
    if( actionType == 'new' )
    {
        form.action = '<%=chipTracContext%>/newproformaInvoice.do?action=save';
    }
    else
    {
        form.action = '<%=chipTracContext%>/newproformaInvoice.do?action=update';
    }

    form.submit();
}

function cancelAndGoBack()
{
    document.proformaInvoiceForm.action = '<%=chipTracContext%>/newproformaInvoice.do?action=searchInvoices';
    document.proformaInvoiceForm.submit();
}
function loadBankInfo()
{
	var banktext = '';
	var bankid     = document.proformaInvoiceForm.bankId.value;
	var totalbanks = document.proformaInvoiceForm.bankId.length;
	var indexValue =  document.proformaInvoiceForm.bankId.selectedIndex;

		if( bankid != 0 )
		{
				//flag = true;
				for(aa=0; aa<totalbanks; aa++)
				{
					 banktext = '';
					if( bankid == bankID[aa] )
					{
						banktext = '<table border="0" width="100%" bordercolor="black" align=center>';
						banktext = banktext +'<tr><td width="23%" class="NArialL" align="left" >Bank Name &nbsp;<font color="red"> * </font></td>';
						banktext = banktext +'<td width="30%" align="left" ><input type="text" name="bankName" value="'+bankName[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td width="23%" class="NArialL" align="left">Address   </td>';
						banktext = banktext +'<td width="25%" align="right" ><input type="text" name="bankAddress1" value="'+address[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >City </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="bankCity" value="'+city[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">State</td>';
						banktext = banktext +'<td align="right" ><input type="text" name="bankState" value="'+state[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >ZipCode </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="bankZipCode" value="'+zipcode[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">Country</td>';
						banktext = banktext +'<td align="right" ><input type="text" name="bankCountry" value="'+country[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >Aba </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="aba" value="'+aba[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">Acct</td>';
						banktext = banktext +'<td align="right" ><input type="text" name="acct" value="'+acct[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >SwiftCode </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="swiftcode" value="'+swiftcode[aa]+'" class="txfield" maxlength="50" /></td></tr>';

						var pa=document.getElementById("font1");
						pa.innerHTML = banktext;
                    }
					else if( bankid == -1 || bankid == '')
					{
						banktext = '<table border="0" width="100%" bordercolor="black" align=center>';
						banktext = banktext +'<tr><td width="23%" class="NArialL" align="left" >Bank Name &nbsp;<font color="red"> * </font></td>';
						banktext = banktext +'<td width="30%" align="left" ><input type="text" name="bankName" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td width="23%" class="NArialL" align="left">Address</td>';
						banktext = banktext +'<td width="25%" align="center" ><input type="text" name="bankAddress1" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >City </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="bankCity" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">State</td>';
						banktext = banktext +'<td align="center" ><input type="text" name="bankState" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >ZipCode </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="bankZipCode" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">Country</td>';
						banktext = banktext +'<td align="center" ><input type="text" name="bankCountry" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >Aba </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="aba" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">Acct</td>';
                            banktext = banktext +'<td align="center" ><input type="text" name="acct" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >SwiftCode </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="swiftcode" value="" class="txfield" maxlength="50" /></td></tr>';
						var pa=document.getElementById("font1");
						pa.innerHTML = banktext;
					}
				}
       }
	   else if( bankid == 0 )
	   {
		    banktext = '';
			var pa = document.getElementById("font1");
			pa.innerHTML = banktext;
	   }

}

function check()
{
	var bankidd = document.proformaInvoiceForm.bankId.value;
	var totalbanks = document.proformaInvoiceForm.bankId.length;
	if( bankidd != 0 )
		{
				//flag = true;
				for(aa=0; aa<totalbanks; aa++)
				{
					banktext = '';
					if( bankidd == bankID[aa] )
					{
						banktext = '<table border="0" width="100%" bordercolor="black" align=center>';
						banktext = banktext +'<tr><td width="23%" class="NArialL" align="left" >Bank Name &nbsp;<font color="red"> * </font></td>';
						banktext = banktext +'<td width="30%" align="left" ><input type="text" name="bankName" value="'+bankName[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td width="23%" class="NArialL" align="left">Address</td>';
						banktext = banktext +'<td width="25%" align="right" ><input type="text" name="bankAddress1" value="'+address[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >City </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="bankCity" value="'+city[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">State</td>';
						banktext = banktext +'<td align="right" ><input type="text" name="bankState" value="'+state[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >ZipCode </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="bankZipCode" value="'+zipcode[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">Country</td>';
						banktext = banktext +'<td align="right" ><input type="text" name="bankCountry" value="'+country[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >Aba </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="aba" value="'+aba[aa]+'" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="left">Acct</td>';
						banktext = banktext +'<td align="right" ><input type="text" name="acct" value="'+acct[aa]+'" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >SwiftCode </td>';
						banktext = banktext +'<td align="left" ><input type="text" name="swiftcode" value="'+swiftcode[aa]+'" class="txfield" maxlength="50" /></td></tr>';

						var pa=document.getElementById("font1");
						pa.innerHTML = banktext;
                    }
					else if( bankidd == -1 || bankidd == '')
					{
						banktext = '<table border="0" width="100%" bordercolor="black" align=center>';
						banktext = banktext +'<tr><td width="23%" class="NArialL" align="left" >Bank Name &nbsp;<font color="red"> * </font></td>';
						banktext = banktext +'<td width="30%" align="center" ><input type="text" name="bankName" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td width="23%" class="NArialL" align="right">Address</td>';
						banktext = banktext +'<td width="25%" align="center" ><input type="text" name="bankAddress1" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >City </td>';
						banktext = banktext +'<td align="center" ><input type="text" name="bankCity" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="right">State</td>';
						banktext = banktext +'<td align="center" ><input type="text" name="bankState" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >ZipCode </td>';
						banktext = banktext +'<td align="center" ><input type="text" name="bankZipCode" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="right">Country</td>';
						banktext = banktext +'<td align="center" ><input type="text" name="bankCountry" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >Aba </td>';
						banktext = banktext +'<td align="center" ><input type="text" name="aba" value="" class="txfield" maxlength="50" /></td>';
						banktext = banktext +'<td class="NArialL" align="right">Acct</td>';
						banktext = banktext +'<td align="center" ><input type="text" name="acct" value="" class="txfield" maxlength="50"/></td></tr>';

						banktext = banktext +'<tr><td class="NArialL" align="left" >SwiftCode </td>';
						banktext = banktext +'<td align="center" ><input type="text" name="swiftcode" value="" class="txfield" maxlength="50" /></td></tr>';

						var pa=document.getElementById("font1");
						pa.innerHTML = banktext;
					}
				}
		}
		else if( bankidd == 0 )
	   {
		    banktext = '';
			var pa = document.getElementById("font1");
			pa.innerHTML = banktext;
	   }
}

    
</SCRIPT>
</HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" onload="check();">
<!-- Top Header Start-->
<%@include file="/jsp/includes/header.jsp"  %>
<!-- Top Header End-->
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
    <tr>
	    <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
            <!-- Side Navigation start -->
            <%@include file="/jsp/finance/finance_menu.jsp" %>
            <!-- end of the side navigations -->
        </td>
        <td bgcolor="#ffffff"><img height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></td>
        <td bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></td>
        <td valign="top" width="100%"><img height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
            <BR>
            <center><span class="NArialW">Pro Forma Invoice</span></center>
            <html:form name="proformaInvoiceForm" type="com.scalar.chiptrack.finance.proformainvoice.forms.ProformaInvoiceForm" action="/newproformaInvoice.do">

            <table border='0' width='90%' align='center' class='NArialL'>
                <tr><td colspan='5'><chiptrack:info styleClass='NArialL'/></td></tr>
                <tr><td colspan='5'><chiptrack:errors styleClass='NArialL'/></td></tr>
                <tr>
                    <td>
                        <html:hidden property="invoiceId"/>
                        <html:hidden property="salesOrderId"/>
                        <input type="hidden" name="actionType" value="<bean:write name="actionType"/>">
                        &nbsp;<FONT id="errors" color='FF0000'></font>
                    </td>
                </tr>
            </table>
            <nested:nest property="salesOrder">
            <table width="90%" cellspacing='0' cellpadding='0' border="0" align="center" class='NArialL'>
                <tr><td colspan="5"><img height=10 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></td></tr>
                <tr>
                    <td colspan="2" bgcolor='#FFFFEE' valign=top>
                        <table border="0" width="100%" class="NArialL">
                            <tr>
                                <td class="NArialL" bgcolor="#DEE1E2" >Invoice No.:</td>
                                <td>
                                    <html:text property="invoiceNo" styleClass='txfield' maxlength="50"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="NArialL" bgcolor="#DEE1E2" >Invoice Date:</td>
                                <td>
                                    <html:text property='invoiceDate' styleClass='txfield' maxlength="50" disabled="true"/>
                                    <%--<a href="javascript:openCalendar( document.proformaInvoiceForm.invoiceDate )">
                                        <img onMouseOver="window.status='Click  to select date';return true" onMouseout="window.status='';return 	true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20>
                                    </a>--%>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td colspan="3"><img height=10 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></td>
                </tr>
                <tr><td colspan="5"><img height=10 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></td></tr>
                
                <tr height=30>
                    <td width="34%" class="NArialL" bgcolor="#DEE1E2" >Bill To:</td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td width="30%" class="NArialL">&nbsp;</td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td width="34%"  bgcolor="#DEE1E2">Ship To:</td>
                </tr>
                <tr>
                    <td bgcolor='#FFFFEE' valign=top>
                        <table width="100%" class="NArialL">
                            <tr>
                                <td>
                                    <nested:write property="billingAddressAsHTML" filter="false"/>
                                </td>
                            </tr>
			            </table>
                    </td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td class="NArialL">&nbsp;</td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td bgcolor='#FFFFEE' class="NArialL" valign=top>
                        <table width="100%" class="NArialL">
                            <tr>
                                <td>
                                    <nested:write property="shippingAddressAsHTML" filter="false"/>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>
                <tr>
                    <td class="NArialL">
                        <table width="100%" class="NArialL">
                            <tr height=30>
                                <td bgcolor='#DEE1E2'>Customer PO#</td>
                                <td bgcolor='#DEE1E2'>Sales Order#</td>
                            </tr>
                            <tr height=30>
                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="customerPO"/>
                                </td>
                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="salesOrderNo"/>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td class="NArialL">
                        <table width="100%" class="NArialL">
                            <tr height=30>
                                <td bgcolor='#DEE1E2'> Order Date</td>
                                <td bgcolor='#DEE1E2'>Ship Via</td>
                            </tr>
                            <tr height=30>
                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="bookingdateAsString"/>
                                </td>
                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="shippingMethod"/>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td class="NArialL">
                        <table width="100%" class="NArialL">
                            <tr height=30>
                                <td bgcolor='#DEE1E2'>Sales Person</td>
                                <td bgcolor='#DEE1E2'>Regional Rep</td>
                                <td bgcolor='#DEE1E2'>Del Terms</td>
                                <td bgcolor='#DEE1E2'>Pay Terms</td>
                            </tr>
                            <tr height=30>
                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="salesPerson"/>
                                </td>

                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="regionalRep"/>
                                </td>

                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="deliveryTerms"/>
                                </td>

                                <td bgcolor='#FFFFEE'>
                                    <nested:write property="shippingTerms"/>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
        </nested:nest>
                <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>
                <tr>
                    <td colspan='5'>
                        <table width="100%" border=0 cellpadding="2" cellspacing="2">
                            <tr height=30>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Select</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>PO Line#</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>UM</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center><bean:message key = "label.mfgPartNumber" /></td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center><bean:message key = "label.customerPartNumber" /></td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center nowrap>Product Description</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Requested <br>Dock Date</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Scheduled<br>Ship Date</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Revised<br>Ship Date</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Taxable</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Unit <br>Price</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Req Qty</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Remaining Qty</td>
                                <td class="NArialL" bgcolor='#DEE1E2' align=center>Pulled Qty</td>
                            </tr>
                            <nested:size id='lineItemSize' name='proformaInvoiceForm' property='lineItemList'/>
                            <input type='hidden' name='lineItemSize' value='<%=lineItemSize%>'/>
                            <nested:iterate name="proformaInvoiceForm" property="lineItemList" id="proformaLineItem" indexId="lineItemIndex" type="com.scalar.chiptrack.finance.proformainvoice.ProformaInvoiceLineItem" >
                                <tr <% if( lineItemIndex.intValue() % 2 == 0 ){ %> bgcolor='#DEE1E2' <% } else { %> bgcolor='#FFFFEE' <% } %> >
                                <td class="NArialL" align="center">
                                    <% String js = "javascript:selectLineItem(" + ( lineItemIndex.intValue() ) + ")"; %>
                                    <nested:checkbox name="proformaLineItem" property="selected" onclick="<%=js%>"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="poLineItemNo"/>
                                    <nested:hidden name="proformaLineItem" property="poLineItemNo"/>
                                </td>
                                <td class="NArialL" align="center">
                                    ea
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="manufacturingPartNo"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="customerPartNo"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="description"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="requestDate"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="scheduleDate"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="revisedDate"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="isTaxableAsString"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="unitPriceAsString"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="qtyAsString"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:write name="proformaLineItem" property="qtyAvailable"/>
                                    <nested:hidden name="proformaLineItem" property="qtyAvailable"/>
                                </td>
                                <td class="NArialL" align="center">
                                    <nested:equal value="true" property="selected">
                                        <nested:text property="qtyPulledStr" size="8" maxlength="8" styleClass="txfield"/>
                                    </nested:equal>
                                    <nested:equal value="false" property="selected">
                                        <nested:text property="qtyPulledStr" disabled="true" size="8" maxlength="8" styleClass="txfield"/>
                                    </nested:equal>
                                    <input type="hidden" name="intialQtyPulled" value="<nested:write property="qtyPulled"/>">
                                </td>
                            </tr>
                            </nested:iterate>
                        </table>
                    </td>
                </tr>                                
                <tr><td colspan="5"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>
                <nested:nest property="bankAddress">
                <tr>
                    <td colspan="5">
                        <table border="0">
                            <tr>
                                <td align="center" colspan="5" bgcolor='#DEE1E2' class="NArialL">
                                    Banking Information
                                </td>
                            </tr>
                            <tr>
                                <td class="NArialL" align="left">Select Bank Name <font color="red"> * </font> </td>
                                <td>
                                     <html:select property="bankId" styleClass="txfield" onchange="javascript:loadBankInfo();">
                                     <html:options collection="AllBankNames" property="value" labelProperty="label" />
                                     <html:option value="" ></html:option>
                                     <html:option value="-1" > --- Add New Bank --- </html:option>
                                     </html:select>
                                </td>
                                <%--<td bgcolor='#DEE1E2' class="NArialL">Bank Name</td>
                                <td bgcolor='#FFFFEE'><html:text property='bankName' styleClass='txfield' maxlength="50"/></td>--%>
                                <td colspan="3">&nbsp;</td>

                            </tr>

                            <tr><td  colspan='5' align="left"><FONT id="font1"></FONT></TD></TR>
                            <%--<tr>
                                <td bgcolor='#DEE1E2' class="NArialL">Address 1</td>
                                <td bgcolor='#FFFFEE'><nested:text property='address1' styleClass='txfield' maxlength="50"/></td>
                                <td>&nbsp;</td>
                                <td bgcolor='#DEE1E2' class="NArialL">Address 2</td>
                                <td bgcolor='#FFFFEE'><nested:text property='address2' styleClass='txfield' maxlength="50"/></td>
                            </tr>
                            <tr>
                                <td bgcolor='#DEE1E2' class="NArialL">Address 3</td>
                                <td bgcolor='#FFFFEE'><nested:text property='address3' styleClass='txfield' maxlength="50"/></td>
                                <td>&nbsp;</td>
                                <td bgcolor='#DEE1E2' class="NArialL">Address 4</td>
                                <td bgcolor='#FFFFEE'><nested:text property='address4' styleClass='txfield' maxlength="50"/></td>
                            </tr>
                            <tr>
                                <td bgcolor='#DEE1E2' class="NArialL">City</td>
                                <td bgcolor='#FFFFEE'><nested:text property='city' styleClass='txfield' maxlength="50"/></td>
                                <td>&nbsp;</td>
                                <td bgcolor='#DEE1E2' class="NArialL">State</td>
                                <td bgcolor='#FFFFEE'><nested:text property='state' styleClass='txfield' maxlength="50"/></td>
                            </tr>
                            <tr>
                                <td bgcolor='#DEE1E2' class="NArialL">Zip Code</td>
                                <td bgcolor='#FFFFEE'><nested:text property='city' styleClass='txfield' maxlength="50"/></td>
                                <td>&nbsp;</td>
                                <td bgcolor='#DEE1E2' class="NArialL">Country</td>
                                <td bgcolor='#FFFFEE'><nested:text property='country' styleClass='txfield' maxlength="50"/></td>
                            </tr>
                            <tr>
                                <td bgcolor='#DEE1E2' class="NArialL">ABA</td>
                                <td bgcolor='#FFFFEE'><html:text property='aba' styleClass='txfield' maxlength="50"/></td>
                                <td>&nbsp;</td>
                                <td bgcolor='#DEE1E2' class="NArialL">Acct</td>
                                <td bgcolor='#FFFFEE'><html:text property='acct' styleClass='txfield' maxlength="50"/></td>
                            </tr>
                            <tr>
                                <td bgcolor='#DEE1E2' class="NArialL">Swift code</td>
                                <td bgcolor='#FFFFEE'><html:text property='swiftcode' styleClass='txfield' maxlength="50"/></td>
                                <td colspan="3">&nbsp;</td>
                            </tr>--%>
                        </table>
                    </td>
                </tr>
                </nested:nest>
                
                <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>
                <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td colspan="2" class="NArialL" align="left">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="javascript:savePage();" onMouseOver="window.status='Click to save Banking Information ';return true" onMouseOut="window.status='';return true" title="Click here to Save Banking Information ">
                        <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif"></a>
                        &nbsp;&nbsp;
                        <a href="javascript:document.proformaInvoiceForm.reset();" onMouseOver="window.status='Click to Reset Banking Information ';return true" onMouseOut="window.status='';return true" title="Click here to Reset Banking Information ">
                        <img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif"></a>
                        &nbsp;&nbsp;
                        <a href="javascript:cancelAndGoBack();" onMouseOver="window.status='Click to Cancel';return true" onMouseOut="window.status='';return true" title="Click here to Cancel">
                        <img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif"></a>
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>
    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>
</table>
<%--<html:hidden name="proformaInvoiceForm" property="bankId" />--%>
</html:form>
<!-- Footer starts here -->
<%@include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->
</body>
</html>

<%--<% }catch(Exception e){e.printStackTrace();} %>--%>

